#{extends 'Users/frame.html' /}

#{set 'moreStyles'}
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/Users/edit.scss'}" />
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/navigationbar.scss'}" />
#{/set}
<script language="javascript">
$(function(){
	$("#mi_edit").addClass("menu-select");
});
</script>
<div class="navigationBar">
	<table>
		<tr>
			<td><img src="@{'/public/images/navigationHouse.gif'}"></td>
			<td><strong>当前位置：</strong></td>
			<td>
				<a href="/">首页</a>
				>>
				<a href="/users">会员中心</a>
				>>
				<font class="current">资料修改</font>
			</td>
		</tr>
	</table>
</div>
<script language="javascript">
$(function(){
	var validateResult = "#{error 'validateRestle'/}";
	if(validateResult == "SUCC") {
		alert("用户资料修改成功。");
	}
});
</script>
<div id="edit-comment">
	<table>
		#{form @users.update(), name:'form1', id:'form1'}
		<tr>
			<input type="hidden" name="user.id" value="${user.id}">
			<td class="left">用户名：</td>
			<td class="right">
				<strong class="red">${user.username}</strong>
			</td>
		</tr>
		<tr>
			<td class="left">密码提示问题：</td>
			<td class="right">
				<input type="texe" name="user.question" value="${user.question}" >
				<font class="red">*</font>&nbsp;
				<span class="error">#{error 'user.question' /}</span>
			</td>
		</tr>
		<tr>
			<td class="left">密码提示答案：</td>
			<td class="right">
				<input type="texe" name="user.answer" value="${user.answer}" >
				<font class="red">*</font>&nbsp;
				<span class="error">#{error 'user.answer' /}</span>
			</td>
		</tr>
		<tr>
			<td class="left">真实姓名：</td>
			<td class="right">
				${user.realname}
			</td>
		</tr>
		<tr>
			<td class="left">性别：</td>
			<td class="right">
				${user.sex}
			</td>
		</tr>
		<tr>
			<td class="left">生日：</td>
			<td class="right">
				${user.birthday.format('yyyy-MM-dd')}
			</td>
		</tr>
		<tr>
			<td class="left">省市：</td>
			<td class="right">
				${user.province}省 ${user.city}市
			</td>
		</tr>
		<tr>
			<td class="left">销售模式：</td>
			<td class="right"><input type="texe" name="user.salesmode" value="${user.salesmode}" ></td>
		</tr>
		<tr>
			<td class="left">详细收货地址：</td>
			<td class="right"><input type="texe" name="user.deliveryAddress" value="${user.deliveryAddress}" ></td>
		</tr>
		<tr>
			<td class="left">邮政编码：</td>
			<td class="right"><input type="texe" name="user.zipcode" value="${user.zipcode}" ></td>
		</tr>
		<tr>
			<td class="left">联系电话或手机：</td>
			<td class="right"><input type="texe" name="user.phoneNo" value="${user.phoneNo}" ></td>
		</tr>
		<tr>
			<td class="left">QQ：</td>
			<td class="right"><input type="texe" name="user.qqNo" value="${user.qqNo}" ></td>
		</tr>
		<tr>
			<td class="left">MSN：</td>
			<td class="right"><input type="texe" name="user.msnNo" value="${user.msnNo}" ></td>
		</tr>
		<tr>
			<td class="left">E-mail：</td>
			<td class="right">
				<input type="texe" name="user.email" value="${user.email}" >
				<font class="red">*</font>&nbsp;
				<span class="error">#{error 'user.email' /}</span>
			</td>
		</tr>
		#{/form}
		<tr>
			<td class="left">
				<input class="button" type="image" src="@{'/public/images/btn_submit.jpg'}" value="提交" onclick="postData()">
			</td>
			<td class="right">
				<a href="/users/edit"><input class="button" type="image" src="@{'/public/images/btn_reset.jpg'}" value="重置"></a>
			</td>
		</tr>
	</table>
	<script language="javascript">
	function postData() {
		$('form').submit();
	}
	</script>
</div>